/*
   Copyright (c) 2023 李伟国
   learner-platform is licensed under Mulan PSL v2.
   You can use this software according to the terms and conditions of the Mulan PSL v2.
   You may obtain a copy of Mulan PSL v2 at:
               http://license.coscl.org.cn/MulanPSL2
   THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.  
   See the Mulan PSL v2 for more details. 
*/

package cn.platform.mapper;

import cn.platform.dto.PermissionChildren;
import cn.platform.entity.Permission;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PermissionMapper extends BaseMapper<Permission> {
    List<PermissionChildren> selectByPcode(@Param("pcode") String pCode, @Param("isMenu") Boolean isMenu, @Param("userId") Long userId);
    List<PermissionChildren> selectByLevels(@Param("levels") Integer levels, @Param("isMenu") Integer isMenu);
    int updateStatusById(@Param("status") String status, @Param("id") Long id);
    List<PermissionChildren> selectMenuByUserId(@Param("userId") Long userId, @Param("levels") int levels);
    List<String> selectListByUserId(@Param("userId") Long userId);
}
